<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="/resources/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/resources/easyui/themes/icon.css">
    <script type="text/javascript" src="/resources/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/resources/easyui/jquery.easyui.min.js"></script>
</head>

<body>
<div class="easyui-panel" title="详细信息" style="width:100%;width:400px;padding:30px 60px;">
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" id="goodsname" name="goodsname" style="width:100%"
               data-options="label:'商品名称:',required:true" value=""/>
    </div>
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" id="money" name="money" style="width:100%"
               data-options="label:'金额:',required:true" value=""/>
    </div>
    <div style="margin-bottom:20px">
        <input class="easyui-datetimebox" id="paydate" name="paydate" style="width:100%"
               data-options="label:'付款日期:',required:true,formatter:myformatter" value=""/>
    </div>
    <div style="text-align:center;padding:5px 0">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">提交</a>
    </div>
</div>
<script>
    function submitForm() {
        $.post("/buyssave", {
            userid:${userid!''},
            money: $("#money").val(),
            goodsname: $("#goodsname").val(),
            paydate: $("#paydate").val()
        }, function () {
            alert("增加成功");
        });
    }
    function myformatter(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        var h = date.getHours()
        var mm = date.getMinutes();
        var s = date.getSeconds();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d) + ' ' + (h < 10 ? ('0' + h) : h) + ':' + (mm < 10 ? ('0' + mm) : mm) + ':' + (s < 10 ? ('0' + s) : s);
    }
</script>
</body>
</html>